<include file="SpStore:header" />
		<!----《/头部结束》----->
		<div class="ncsc-layout wrapper">
			<include file="SpStore:goods_left" />
			<div id="layoutRight" class="ncsc-layout-right">
				<div class="ncsc-path">
					<i class="icon-desktop"></i>商家管理中心
					<i class="icon-angle-right"></i>商品
					<i class="icon-angle-right"></i>仓库中的商品
				</div>
				<div class="main-content" id="mainContent">

					<div class="tabmenu">
						<ul class="tab pngFix">
							<li class="normal">
								<a href="/store/depot_list">仓库中的商品</a>
							</li>
							<li class="active">
								<a href="/store/gout_list">违规的商品</a>
							</li>
							<li class="normal">
								<a href="/store/g_await_list">等待审核的商品</a>
							</li>
						</ul>
					</div>
					<form method="get" action="index.php">
						<table class="search-form">
							<input type="hidden" name="act" value="store_goods_offline">
							<input type="hidden" name="op" value="index">
							<tbody>
								<tr>
									<td>&nbsp;</td>
									<th>本店分类</th>
									<td class="w160">
										<select name="stc_id" class="w150">
											<option value="0">请选择...</option>
										</select>
									</td>
									<th>
										<select name="search_type">
											<option value="0" selected="selected">商品名称</option>
											<option value="1">商家货号</option>
											<option value="2">平台货号</option>
										</select>
									</th>
									<td class="w160">
										<input type="text" class="text" name="keyword" value="">
									</td>
									<td class="tc w70">
										<label class="submit-border">
											<input type="submit" class="submit" value="搜索">
										</label>
									</td>
								</tr>
							</tbody>
						</table>
					</form>
					<table class="ncsc-default-table">
						<thead>
							<tr nc_type="table_header">
								<th class="w30"></th>
								<th class="w50"></th>
								<th>商品名称</th>
								<th class="w180">上架</th>
								<th class="w100">价格</th>
								<th class="w100">库存</th>
								<th class="w100">商品状态</th>
								<th class="w100">操作</th>
							</tr>
							<tr>
								<td class="tc"><input type="checkbox" id="all" class="checkall"></td>
								<td colspan="10"><label for="all">全选</label>
									<a href="javascript:void(0);" class="ncsc-btn-mini" name="commonid"><i class="icon-trash"></i>删除</a>
									<!-- <a href="javascript:void(0);" class="ncsc-btn-mini" name="commonid" data-type="comdown"><i class="icon-level-up"></i>上架</a> -->
								</td>
							</tr>
						</thead>
						<tbody>
							<foreach name="list" item="vo">
							<tr>
								<th class="tc"><input type="checkbox" class="checkitem tc" data-id="{$vo.id}" data-state="1" name="checkbox"></th>
								<th colspan="20">平台货号：{$vo.number}</th>
							</tr>
							<tr>
								<td class="trigger"></td>
								<td>
									<div class="pic-thumb">
										<a href="/shop/goods.html?gid={$vo.id}" target="_blank"><img src="{$vo.pic}"></a>
									</div>
								</td>
								<td class="tl">
									<dl class="goods-name">
										<dt style="max-width: 450px !important;">
                                            <a href="/shop/goods.html?gid={$vo.id}" target="_blank">{$vo.productname}</a></dt>
										<dd>商家货号：{$vo.goods_number}</dd>
										<dd class="serve"> 
											<span class="open" title="店铺推荐商品">
												<in name="vo.goods_commend" value="1">
												<i class="commend">荐</i>
												</in>
											</span> 
<!-- 											<span class="open" title="手机端商品详情">
												<i class="icon-tablet"></i>
											</span> 
											<span class="" title="商品页面二维码">
												<i class="icon-qrcode"></i>
									            <div class="QRcode">
									            	<a target="_blank" href="#">下载标签</a>
									              <p><img src="images/web-2-28-1.png"></p>
									            </div>
								            </span> -->
										</dd>
									</dl>
								</td>
								<td id="depot_on">
								<if condition="$vo.goods_state eq '10'">
									
								<else/>
								<!-- <a href="javascript:void(0)" class="ncsc-btn" data-id="{$vo.id}" data-state="1">上架</a> -->
								</if>	
								</td>
								
								<td><span>
								<if condition="$vo.price gt 0">
								￥{$vo.price}
									<if condition="$vo.point_num gt 0">
										+
									</if>
								</if>
								<if condition="$vo.point_num gt 0">
								{$vo.point_num}&nbsp;积分
								</if>
								<if condition="$vo.coin_num gt 0">
								{$vo.coin_num}&nbsp;增值币
								</if>									
								</span></td>
								
								<td><span>{$vo.goods_storage}件</span></td>
								<td class="goods-time" style="color:#27A9E3;">
								<if condition="$vo.goods_verify eq '1'">
								通过
								</if>
								<if condition="$vo.goods_verify eq '0'">
									<if condition="$vo.goods_state eq '10'">
										<font style="color:red;">违规（禁售）</font>
									<else/>
									<font style="color:red;">未通过</font>									
									</if>								
								</if>
								<if condition="$vo.goods_verify eq '10'">
								审核中
								</if>								
								</td>
								<td class="nscs-table-handle">
									<span><a href="/store/store_goods_add?op=add_step_two&goodsid={$vo.id}" class="btn-blue"><i class="icon-edit"></i><p>编辑</p></a></span>
									<span id="goodsdel">
										<a href="javascript:void(0);" class="btn-red" data-id="{$vo.id}">
											<i class="icon-trash"></i>
									        <p>删除</p>
								        </a>
									</span>
								</td>
							</tr>
							<tr style="display:none;">
								<td colspan="20">
									<div class="ncsc-goods-sku ps-container"></div>
								</td>
							</tr>
							</foreach>
							
						</tbody>
						<tfoot>
							<tr>
								<th class="tc"><input type="checkbox" id="all2" class="checkall"></th>
								<th colspan="10"><label for="all2">全选</label>
									<a href="javascript:void(0);" class="ncsc-btn-mini" nc_type="batchbutton" name="commonid"><i class="icon-trash"></i>删除</a>
									<!-- <a href="javascript:void(0);" class="ncsc-btn-mini" data-type="comdown" name="commonid"><i class="icon-level-up" ></i>上架</a> -->
								</th>
							</tr>
							<tr>
								<td colspan="20">
									<div class="pagination">
										<ul>
											{$page}
										</ul>
									</div>
								</td>
							</tr>
						</tfoot>
					</table>

				</div>
			</div>
			</div>
		<script type="text/javascript">
			//删除产品
			$("#goodsdel a").live('click',function(){
				var id = $(this).attr('data-id');
				
				if (id) {
					data_del(id) ;
				}
				//alert(id);														
			});
			
			
			
			//产品上架
			$("#depot_on a").live('click',function(){
				var id = $(this).attr('data-id');
				var state = $(this).attr('data-state');
				if(id) {
					data_depot(id,state) ;
				}
				//alert(id);														
			});
			
			//产品上架
			$("[data-type='comdown']").live('click',function(){
				var id = '' ;
				var state = '' ;
				$("[name='checkbox']").each(function(){
				
					if ($(this).is(':checked')) {
						
					    id += $(this).attr('data-id')+',' ;
					    state += $(this).attr('data-state')+',' ;						
					}	
				})	
				//alert(id);
				if(id) {
					data_depot(id,state) ;
				}
			});
			
			
			function data_depot(id,state){
				if (id) {
					if(confirm("确定要上架吗？")){
					
					$.ajax({
						type:'post',
						url:"/store/data_depot",
						data:{id:id,state:state},
						dataType:'json',
						success: function(e) {
							if(e.info){
								alert(e.info);
								window.location.reload();
							}
						}
					});
					
					//是										
					}else{

					//否
					return false;

					}
				}		
			}
			function data_del(id){
				if (id) {
					if(confirm("确定要删除吗？")){
					
					$.ajax({
						type:'post',
						url:"/store/data_del",
						data:{id:id,state:0},
						dataType:'json',
						success: function(e) {

							if(e.info){
								alert(e.info);
								window.location.reload();
							}
						}
					});
					
					//是										
					}else{

					//否
					return false;

					}
				}		
			}
		</script>


			<!--底部-->

<include file="SpStore:footer" />
	</body>

</html>